package com.umeng.fb.a;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import com.umeng.common.b.g;
import com.umeng.fb.a;
import com.umeng.fb.a.a;
import com.umeng.fb.b;
import com.umeng.fb.b.a;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class d extends Thread
{
  private static ExecutorService b = Executors.newFixedThreadPool(3);
  private Context a;

  public d(Context paramContext)
  {
    this.a = paramContext;
  }

  public void run()
  {
    label39: Iterator localIterator2;
    b localb;
    int i = 0;
    ArrayList localArrayList = new ArrayList();
    SharedPreferences localSharedPreferences = this.a.getSharedPreferences("feedback", 0);
    Iterator localIterator1 = localSharedPreferences.getAll().keySet().iterator();
    if (!(localIterator1.hasNext()))
      localIterator2 = localArrayList.iterator();
    do
    {
      while (true)
      {
        if (localIterator2.hasNext())
          break label164;
        if (i != 0)
        {
          Intent localIntent = new Intent().setAction("postFeedbackFinished");
          this.a.sendBroadcast(localIntent);
        }
        return;
        String str1 = localSharedPreferences.getString((String)localIterator1.next(), null);
        if ((!(g.c(str1))) && (str1.indexOf("fail") != -1));
        try
        {
          localArrayList.add(new b(new JSONArray(str1)));
        }
        catch (Exception localException)
        {
        }
      }
      break label39:
      label164: localb = (b)localIterator2.next();
    }
    while ((localb.b == b.a.d) || (localb.b == b.a.a));
    Iterator localIterator3 = localb.f.iterator();
    int j = i;
    int k = -1;
    while (true)
    {
      if (!(localIterator3.hasNext()))
        i = j;
      a locala = (a)localIterator3.next();
      ++k;
      if (locala.g != a.a.b)
        continue;
      String str2 = localSharedPreferences.getString(localb.c, null);
      try
      {
        JSONArray localJSONArray = new JSONArray(str2);
        localJSONArray.put(k, locala.h.put("state", a.a.d));
        localSharedPreferences.edit().putString(localb.c, localJSONArray.toString()).commit();
        f localf = new f(locala.h, this.a);
        if (localf != null);
        b.submit(localf);
        j = 1;
      }
      catch (JSONException localJSONException)
      {
      }
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     com.umeng.fb.a.d
 * JD-Core Version:    0.5.2
 */